package com.cqc.indexbar01;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        IndexBar indexBar = findViewById(R.id.indexBar);
        indexBar.setOnClickListener(new IndexBar.OnClickListener() {
            @Override
            public void update(String letter) {
                Toast.makeText(MainActivity.this,letter,Toast.LENGTH_SHORT).show();
            }
        });

    }

}
